home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 2002 November / SGI Freeware 2002 November - Disc 2.iso / dist / fw_imlib.idb / usr / freeware / include / Imlib_types.h.z / Imlib_types.h
C/C++ Source or Header  |  2002-07-08  |  5KB  |  192 lines

  1. #include <X11/Xlib.h>
  2. #include <X11/Xutil.h>
  3. #include <X11/Xatom.h>
  4. #include <X11/Xos.h>
  5. #ifdef HAVE_XSHM_H
  6. #include <X11/extensions/XShm.h>
  7. #endif
  8. #include <X11/extensions/shape.h>
  9. #include <stdio.h>
  10. #include <unistd.h>
  11. #include <stdlib.h>
  12. #include <math.h>
  13. #include <ctype.h>
  14. #include <time.h>
  15. #include <netinet/in.h>
  16. #ifdef HAVE_IPC_H
  17. #include <sys/ipc.h>
  18. #endif
  19. #ifdef HAVE_SHM_H
  20. #include <sys/shm.h>
  21. #endif
  22. #include <sys/time.h>
  23. #include <sys/types.h>
  24.  
  25. #ifdef _HAVE_STRING_H
  26. #include <string.h>
  27. #elif _HAVE_STRINGS_H
  28. #include <strings.h>
  29. #endif
  30.  
  31. #ifndef SYSTEM_IMRC
  32. #define SYSTEM_IMRC "/etc/imrc"
  33. #endif /* endef SYSTEM_IMRC */
  34.  
  35. typedef struct _ImlibBorder ImlibBorder;
  36. typedef struct _ImlibColor ImlibColor;
  37. typedef struct _ImlibColorModifier ImlibColorModifier;
  38. typedef struct _ImlibImage ImlibImage;
  39. typedef struct _xdata Xdata;
  40. typedef struct _ImlibData ImlibData;
  41. typedef struct _ImlibSaveInfo ImlibSaveInfo;
  42. typedef struct _ImlibInitParams ImlibInitParams;
  43.  
  44. struct _ImlibBorder
  45.   {
  46.     int                 left, right;
  47.     int                 top, bottom;
  48.   };
  49.  
  50. struct _ImlibColor
  51.   {
  52.     int                 r, g, b;
  53.     int                 pixel;
  54.   };
  55.  
  56. struct _ImlibColorModifier
  57.   {
  58.     int                 gamma;
  59.     int                 brightness;
  60.     int                 contrast;
  61.   };
  62.  
  63. struct _ImlibImage
  64.   {
  65.     int                 rgb_width, rgb_height;
  66.     unsigned char      *rgb_data;
  67.     unsigned char      *alpha_data;
  68.     char               *filename;
  69. /* the below information is private */
  70.     int                 width, height;
  71.     ImlibColor          shape_color;
  72.     ImlibBorder         border;
  73.     Pixmap              pixmap;
  74.     Pixmap              shape_mask;
  75.     char                cache;
  76.     ImlibColorModifier  mod, rmod, gmod, bmod;
  77.     unsigned char       rmap[256], gmap[256], bmap[256];
  78.   };
  79.  
  80. struct _xdata
  81.   {
  82.     Display            *disp;
  83.     int                 screen;
  84.     Window              root;
  85.     Visual             *visual;
  86.     int                 depth;
  87.     int                 render_depth;
  88.     Colormap            root_cmap;
  89.     char                shm;
  90.     char                shmp;
  91.     int                 shm_event;
  92.     XImage             *last_xim;
  93.     XImage             *last_sxim;
  94. #ifdef HAVE_XSHM_H
  95.     XShmSegmentInfo     last_shminfo;
  96.     XShmSegmentInfo     last_sshminfo;
  97. #endif
  98.     Window              base_window;
  99.     int                 byte_order, bit_order;
  100.   };
  101.  
  102. struct _ImlibData
  103.   {
  104.     int                 num_colors;
  105.     ImlibColor         *palette;
  106.     ImlibColor         *palette_orig;
  107.     unsigned char      *fast_rgb;
  108.     int                *fast_err;
  109.     int                *fast_erg;
  110.     int                *fast_erb;
  111.     int                 render_type;
  112.     int                 max_shm;
  113.     Xdata               x;
  114.     int                 byte_order;
  115.     struct _cache
  116.       {
  117.     char                on_image;
  118.     int                 size_image;
  119.     int                 num_image;
  120.     int                 used_image;
  121.     struct image_cache *image;
  122.     char                on_pixmap;
  123.     int                 size_pixmap;
  124.     int                 num_pixmap;
  125.     int                 used_pixmap;
  126.     struct pixmap_cache *pixmap;
  127.       }
  128.     cache;
  129.     char                fastrend;
  130.     char                hiq;
  131.     ImlibColorModifier  mod, rmod, gmod, bmod;
  132.     unsigned char       rmap[256], gmap[256], bmap[256];
  133.     char                fallback;
  134.     char                ordered_dither;
  135.   };
  136.  
  137. struct _ImlibSaveInfo
  138.   {
  139.     int                 quality;
  140.     int                 scaling;
  141.     int                 xjustification;
  142.     int                 yjustification;
  143.     int                 page_size;
  144.     char                color;
  145.   };
  146.  
  147. struct _ImlibInitParams
  148.   {
  149.     int                 flags;
  150.     int                 visualid;
  151.     char               *palettefile;
  152.     char                sharedmem;
  153.     char                sharedpixmaps;
  154.     char                paletteoverride;
  155.     char                remap;
  156.     char                fastrender;
  157.     char                hiquality;
  158.     char                dither;
  159.     int                 imagecachesize;
  160.     int                 pixmapcachesize;
  161.     Colormap            cmap;
  162.   };
  163.  
  164. #define PARAMS_VISUALID        1<<0
  165. #define PARAMS_PALETTEFILE     1<<1
  166. #define PARAMS_SHAREDMEM       1<<2
  167. #define PARAMS_SHAREDPIXMAPS   1<<3
  168. #define PARAMS_PALETTEOVERRIDE 1<<4
  169. #define PARAMS_REMAP           1<<5
  170. #define PARAMS_FASTRENDER      1<<6
  171. #define PARAMS_HIQUALITY       1<<7
  172. #define PARAMS_DITHER          1<<8
  173. #define PARAMS_IMAGECACHESIZE  1<<9
  174. #define PARAMS_PIXMAPCACHESIZE 1<<10
  175. #define PARAMS_COLORMAP        1<<11
  176.  
  177. #define PAGE_SIZE_EXECUTIVE    0
  178. #define PAGE_SIZE_LETTER       1
  179. #define PAGE_SIZE_LEGAL        2
  180. #define PAGE_SIZE_A4           3
  181. #define PAGE_SIZE_A3           4
  182. #define PAGE_SIZE_A5           5
  183. #define PAGE_SIZE_FOLIO        6
  184.  
  185. #define RT_PLAIN_PALETTE       0
  186. #define RT_PLAIN_PALETTE_FAST  1
  187. #define RT_DITHER_PALETTE      2
  188. #define RT_DITHER_PALETTE_FAST 3
  189. #define RT_PLAIN_TRUECOL       4
  190. /* a special high-quality renderer for people with 15 and 16bpp that dithers */
  191. #define RT_DITHER_TRUECOL      5
  192.